package mi.payment.ui.other;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import mi.payment.R;
import mi.payment.constants.Params;
import mi.payment.ui.base.BaseInputAdminPwdActivity;
import mi.payment.ui.director.UpdatePasswordActivity;

/**
 * 更新密码的输入主管密码界面
 *
 * @author by lj on 2017/3/26.
 */
public class UpdatePwdInputAdminPwd extends BaseInputAdminPwdActivity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setAutoFinish(false);
        initData();
    }

    private void initData() {
        cardNumber.setVisibility(View.GONE);
        cardMoney.setVisibility(View.GONE);
        cardTime.setVisibility(View.GONE);
        cardProof.setVisibility(View.GONE);
        cardRefer.setVisibility(View.GONE);
        transactionType.setVisibility(View.GONE);
        ensureData.setVisibility(View.GONE);
        title.setTitleText(getString(R.string.update_pwd_operator));
    }



    @Override
    public void clickListener() {
        if (isPasswordRight()) {
            startUpdatePwdAct();
        } else {
            passwordInputView.clearText();
            showToast(getString(R.string.password_wrong));
        }
    }

    private void startUpdatePwdAct() {
        Intent intent = new Intent(this, UpdatePasswordActivity.class);
        intent.putExtra("user_info", Params.userInfo);
        // 一般操作员传1，系统操作员传3
        intent.putExtra("who_update", 1);
        startActivity(intent);
        finish();
    }

}
